import { lazy } from 'react'
import { Navigate } from 'react-router-dom'
import type { RoutePropsExtend } from './route.ts'

const RuimView = lazy(() => import('@/pages/system/ruim/ruim.tsx'))
const RuimTool = lazy(() => import('@ruim/ruim-tools/ruim-tools.tsx'))
const Experience = lazy(() => import('@ruim/experience/experience.tsx'))
const Blog = lazy(() => import('@ruim/blog/blogs.tsx'))
const Collect = lazy(() => import('@ruim/collect/collect.tsx'))
const Produce = lazy(() => import('@ruim/produce/produce.tsx'))
const ProduceAI = lazy(() => import('@ruim/produce-ai/produce-ai.tsx'))
const Maidan = lazy(() => import('@ruim/maidan/maidan.tsx'))
const Classroom = lazy(() => import('@ruim/classroom/classroom.tsx'))
const ClassroomAI = lazy(() => import('@ruim/classroom-ai/calssroom-ai.tsx'))
const OnlineCourse = lazy(() => import('@ruim/online-course/online-course.tsx'))

const routers: Array<RoutePropsExtend> = [
  {
    path: '/ruim',
    element: <RuimView></RuimView>,
    children: [
      {
        index: true,
        element: <Navigate to={'/ruim/about'}></Navigate>
      },
      {
        path: '/ruim/about',
        meta: {
          title: 'Ruim',
          icon: ''
        },
        element: <RuimTool></RuimTool>
      },
      {
        path: '/ruim/experience',
        meta: {
          title: '音乐心得',
          icon: '',
          group: '乐帖'
        },
        element: <Experience></Experience>
      },
      {
        path: '/ruim/blog',
        meta: {
          title: '音乐帖吧',
          icon: '',
          group: '乐帖'
        },
        element: <Blog></Blog>
      },
      {
        path: '/ruim/collect',
        meta: {
          title: '我的收藏',
          icon: '',
          group: '乐帖'
        },
        element: <Collect></Collect>
      },
      {
        path: '/ruim/produce',
        meta: {
          title: '简约谱曲',
          icon: '',
          group: 'Ruim创乐'
        },
        element: <Produce></Produce>
      },
      {
        path: '/ruim/produce-ai',
        meta: {
          title: 'AI创乐',
          icon: '',
          group: 'Ruim创乐'
        },
        element: <ProduceAI></ProduceAI>
      },
      {
        path: '/ruim/maidan',
        meta: {
          title: '音乐广场',
          icon: '',
          group: 'Ruim创乐'
        },
        element: <Maidan></Maidan>
      },
      {
        path: '/ruim/classroom',
        meta: {
          title: '乐理课堂',
          icon: '',
          group: 'Ruim课堂'
        },
        element: <Classroom></Classroom>
      },
      {
        path: '/ruim/classroom-ai',
        meta: {
          title: 'AI创作课堂',
          icon: '',
          group: 'Ruim课堂'
        },
        element: <ClassroomAI></ClassroomAI>
      },
      {
        path: '/ruim/online-course',
        meta: {
          title: '在线课堂',
          icon: '',
          group: 'Ruim课堂'
        },
        element: <OnlineCourse></OnlineCourse>
      }
    ]
  }
]

export default routers
